{% extends 'account/base.html' %}
{% load staticfiles %}
{% load oauth_tags %}
{% block title %}
<title>修改资料</title>
{% endblock %}


<!--主要内容块-->
{% block main %}
<main>
<div class="container">
    <div class="row">
        <div class="col-12 col-sm-8 col-md-6 offset-sm-2 offset-md-3 px-xl-5">
            <div class="card rounded-0 px-3 px-lg-4">
                <div class="card-header text-center bg-white py-2"><h3 class="my-1 text-info">修改资料</h3></div>
                <div class="card-body">
                    <form class="change_profile" method="post" enctype="multipart/form-data"{% get_user_data request.session.uid as user %} action="/accounts/profile/change/">
                        <div id="div_id_link" class="form-group">
                            <label for="id_link" class="form-control-label ">个人网址</label>
                            <div class="">
                                <input type="url" name="link" maxlength="200" class="urlinput form-control" id="id_link" />
                                <small id="hint_id_link" class="text-muted">提示：网址必须填写以http开头的完整形式</small>
                            </div>
                        </div>
                        <div id="div_id_avatar" class="form-group">
                            <label for="id_avatar" class="form-control-label  requiredField">
                                头像<span class="asteriskField">*</span>
                            </label>
                        <div class="">目前: <a href="/media/{{ user.avatar }}">/media/{{ user.avatar }}</a><br />
                修改:
                            <input type="file" name="avatar" class="clearablefileinput" id="id_avatar" />
                        </div>
                        </div>
                        <button class="btn btn-info btn-sm rounded-0" type="submit">更新资料</button>
                    </form>
                </div>
                <div class="text-center mb-5" id="social-login">
                    <div class="login-title"><span>更多操作</span></div>
                    <div class="more-link mt-3">
                        <a class="btn btn-info btn-sm rounded-0 mx-3" href="/accounts/profile/">查看资料</a>
                        <a class="btn btn-info btn-sm rounded-0 mx-3" href="/">返回首页</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</main>
{% endblock %}
